package ru.niir.goodfil.audit.ui.extractors;

import ru.niir.goodfil.audit.domain.*;
import ru.niir.goodfil.excel.client.ValueExtractor;

/**
 * @author: Кирилл
 */
public class EventClientIdExtractor implements ValueExtractor {
    public Object extract(Object o) {
        if (o instanceof ClientC1NumChangeEvent) {
            return ((ClientC1NumChangeEvent) o).getClientId();
        }

        if (o instanceof ClientDebtChangeEvent) {
            return ((ClientDebtChangeEvent) o).getClientId();
        }

        if (o instanceof ClientDeliveryInfoChangeEvent) {
            return ((ClientDeliveryInfoChangeEvent) o).getClientId();
        }

        if (o instanceof ClientPriceColumnChangeEvent) {
            return ((ClientPriceColumnChangeEvent) o).getClientId();
        }

        if (o instanceof ClientUIEvent) {
            return ((ClientUIEvent) o).getClientId();
        }

        if (o instanceof OrderUIBuildEvent) {
            return ((OrderUIBuildEvent) o).getClientId();
        }

        if (o instanceof PersonalPriceEvent) {
            return ((PersonalPriceEvent) o).getClientId();
        }

        if (o instanceof ReplacementActionEvent) {
            return ((ReplacementActionEvent) o).getManagerId();
        }

        if (o instanceof OrderUIEvent) {
            return ((OrderUIEvent) o).getClientId();
        }

        if (o instanceof OrderItemUIEvent) {
            return ((OrderItemUIEvent) o).getClientId();
        }

        return "";
    }
}
